﻿/*
 * Copyright (C) 2009 Stringray Studios
 * Portions copyright (C) 2013 David Neal Parsons
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

// Map classes from TripleA Map Creator
// Version 1, Part 2
// Only the classes and properties required for the generator
// have been included, plus some additions.
namespace TripleAMapGenerator
{
    public class Player
    {
        public string Name = "";
        public bool Optional = false;
        public string Alliance = "";
        //public Dictionary<string, StartTechnology> AvailableTechnologies = new Dictionary<string, StartTechnology>();
        public int InitialResources = 0;
    }

    public class Territory
    {
        public string Name = "";
        public bool IsWater = false;
        public Player Owner = new Player();
        public int Production = 0;
        public bool IsCapitol = false;
        public bool IsVictoryCity = false;
        public bool IsImpassable = false;
        public List<Unit> Units = new List<Unit>();
        public List<int> placeQty = new List<int>(); // Added for Map Generator - DNP
        public string TerritoryEffect = ""; // Added for Map Generator - DNP
    }

    public class Connection
    {
        public Territory t1 = new Territory();
        public Territory t2 = new Territory();
    }

    public class Unit
    {
        public string Name = "";
        public Cost cost = new Cost();
        public Cost techCost = new Cost(); // Added for Map Generator - DNP
        public Player unitOwner = new Player();
        public UnitAttachment attachment = new UnitAttachment();
        public bool IsAdditional = false; // Added for Map Generator - DNP
    }

    public class UnitAttachment
    {
        public List<UnitOption> options = new List<UnitOption>();
    }

    public class UnitOption
    {
        public string Name = "";
        public object Value = null;
    }

    public class Cost
    {
        public string ResourceType = "";
        public int cost = 0;
        public Result result = new Result();
    }

    public class Result
    {
        public string ResourceOrUnitName = "";
        public int BuyQuantity = 0;
    }

    // Added for Map Generator - DNP
    public class UsedTerritory
    {
        public Territory t1 = new Territory();
    }

    //[Serializable]
    //public class SConnection
    //{
    //    public SConnection(Connection from)
    //    {
    //        t1 = from.t1.Name;
    //        t2 = from.t2.Name;
    //    }
    //    public string t1 = "";
    //    public string t2 = "";
    //}

    //public class Canal
    //{
    //    public string Name = "";
    //    public List<Territory> CanalSeaNeighbors = new List<Territory>();
    //    public List<Territory> LandTerritories = new List<Territory>();
    //}

    //public class Technology
    //{
    //    public string Name = "";
    //    public Player player = new Player();
    //    public bool AlreadyEnabled = false;
    //}

    //public class StartTechnology
    //{
    //    public string Name = "";
    //    public bool InitiallyEnabled = false;
    //}

    //public class GameplaySequence
    //{
    //    public string Name = "";
    //    public string Class = "";
    //    public string Display = "";
    //}

    //public class PlayerSequence
    //{
    //    public string Name = "";
    //    public GameplaySequence Delegate = new GameplaySequence();
    //    public Player player = new Player();
    //    public int MaxRunCount = 0;
    //}

    //public class ProductionFrontier
    //{
    //    public string Name = "";
    //    public List<Unit> UnitsInFrontier = new List<Unit>();
    //}
}
